import request from '@/utils/request'

// 注册用户
export const registerUser = ({ username, password, repassword }) => {
  return request.post('/api/reg', { username, password, repassword })
}

// 登陆
export const tologin = ({ username, password }) => {
  return request.post('/api/login', { username, password })
}

//获得用户信息
export const getuserinfo = () => {
  return request.get('/my/userinfo')
}

// 修改用户数据
export const updatauserinfo = ({ id, nickname, email, username, user_pic }) => {
  return request.put('/my/userinfo', {
    id,
    nickname,
    email,
    username,
    user_pic
  })
}
